package com.itheima.test3;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author:gy
 * @Date: 2025/08/31 10:27
 * @Description:
 */
public class Demo2 {
    public static void main(String[] args) throws Exception {
        //字符缓冲流  写的操作  关联文件
        BufferedWriter bw = new BufferedWriter(new FileWriter("Day11\\c.txt",true));
        //写数据
       /* bw.write(97);
        bw.write(98);*/
       // bw.write("黑马程序员,今天天气很好",2,2);
        char [] chars = {'黑','马','你','好'};
        bw.write(chars,1,1);
       // bw.write("\r\n");
        bw.newLine();
        bw.write("哈哈哈");
       // bw.write("\r\n");
        bw.newLine();
        bw.write("哈哈哈");
        //必须关流
        bw.close();

    }
}
